import { lazy } from 'react'
import React from 'react'
import { createBrowserRouter } from 'react-router-dom'
import type{ RouteObject } from 'react-router-dom'

const TongYong = lazy(() => import('../views/TongYong/Tongyong.tsx'))
const BuJu = lazy(() => import('../views/BuJu/BuJu.tsx'))
const DaoHang = lazy(() => import('../views/DaoHang/DaoHang.tsx'))
const ShuJuLuRu = lazy(() => import('../views/ShuJuLuRu/ShuJuLuRu.tsx'))
const ShuJuZhanShi = lazy(() => import('../views/ShuJuZhanShi/ShuJuZhanShi.tsx'))
const FanKui = lazy(() => import('../views/FanKui/FanKui.tsx'))
const YangShi = lazy(() => import('../views/YangShi/YangShi.tsx'))
const Study = lazy(() => import('../views/Study/Study.tsx'))
const routers: RouteObject[] = [
  {
    path: '/',
    element: React.createElement(TongYong)
  },
  {
    path: '/buju',
    element: React.createElement(BuJu)
  },
  {
    path: '/study',
    element: React.createElement(Study)
  },
  {
    path: '/daohang',
    element: React.createElement(DaoHang)
  },
  {
    path: '/shujuluru',
    element: React.createElement(ShuJuLuRu)
  },
  {
    path: '/shujuzhanshi',
    element: React.createElement(ShuJuZhanShi)
  },
  {
    path: '/fankui',
    element: React.createElement(FanKui)
  },
  {
    path: '/yangshi',
    element: React.createElement(YangShi)
  }
]
const router = createBrowserRouter(
    routers
)
export default router
